# frozen_string_literal: true

module GqlTypes
  class QueryType < GqlTypes::BaseObject
    # simple
    field :ping, String, null: false, description: 'Test the connection.'
    def ping
      'OK'
    end

    field :variable_type, GqlTypes::Bz::VariableTypeType, null: false do
      argument :id, ID, required: true
    end
    def variable_type(id:)
      RulesEngineSchema.object_from_id(id, context)
      VariableType.find id
    end

    # use resolver
    field :variable_types, resolver: GqlResolver::VariableType::Search
  end
end
